﻿using System;

namespace mediaPrime.Sdk
{
    public delegate void MessageEventHandler(object sender, MessageEventArgs e);
    public delegate void QueryRequestEventHandler(object sender, QueryRequestEventArgs e);
    public delegate void QueryResultEventHandler(object sender, QueryResultEventArgs e);

    internal delegate object MessageWithResultEventHandler(object sender, MessageEventArgs e);

    public class MessageEventArgs : EventArgs
    {
        public Message Message { get; set; }

        public MessageEventArgs(Message message)
        {
            Message = message;
        }
    }



    public class QueryResultEventArgs : EventArgs
    {
        public string Sender { get; set; }
        public string Type { get; set; }
        public object Result { get; set; }

        public Exception Exception { get; set; }

        public QueryResultEventArgs(string sender, string type, object result, Exception exception)
        {
            Sender = sender;
            Type = type;
            Result = result;
            Exception = exception;
        }
    }

    public class QueryRequestEventArgs : EventArgs
    {
        public string Sender { get; set; }
        public string Type { get; set; }
        public object Parameters { get; set; }

        public QueryRequestEventArgs(string sender, string type, object parameters)
        {
            Sender = sender;
            Type = type;
            Parameters = parameters;
        }
    }

}
